<!--
学习计划列表
 add by yyp 2019-05-14
-->
<template lang="pug">
  keep-alive
    kalix-table(bizKey="StudyPlan" title='学习计划列表' ref="kalixTable"
    v-bind:tableFields="tableFields"
    v-bind:targetURL="StudyPlanURL"
    v-bind:bizDialog="studyplanDialog"
    v-bind:btnList="studyplanBtnList"
    v-bind:toolbarBtnList="toolbarBtnList"
    bizSearch="studyplanSearch")
      template(slot="tableColumnSlot")
        el-table-column(prop="planTitle" label="学习计划标题" align="center")
        el-table-column(prop="planDate" label="学习计划创建日期" align="center")
          template(slot-scope="scope")
            span {{dataFormat(scope.row.planDate)}}
        el-table-column(prop="planContent" label="学习计划详情" align="center")
        el-table-column(prop="planStartTime" label="学习计划开始时间" align="center")
          template(slot-scope="scope")
            span {{dataFormat(scope.row.planStartTime)}}
        el-table-column(prop="planEndTime" label="学习计划结束时间" align="center")
          template(slot-scope="scope")
            span {{dataFormat(scope.row.planEndTime)}}
        el-table-column(prop="studentId" label="学生ID" align="center")
</template>

<script type="text/ecmascript-6">
  import {StudyPlanURL} from '../../config.toml'
  import {studyplanConfigBtnList} from './config'
  import KalixTable from '../../../../../components/corelib/components/common/baseTable'

  export default {
    name: 'kalix-mooc-studyplan',
    components: {KalixTable},
    data() {
      return {
        StudyPlanURL: StudyPlanURL,
        tableFields: [
        ],
        studyplanDialog: [
          {id: 'add', dialog: 'studyplanAdd'},
          {id: 'edit', dialog: 'studyplanEdit'},
          {id: 'view', dialog: 'studyplanView'}
        ],
        studyplanBtnList: studyplanConfigBtnList,
        toolbarBtnList: [
          {id: 'add', isShow: true, title: '添加', icon: 'icon-pinleizengjia', isPermission: true}
        ]
      }
    },
    methods: {
      dataFormat(val) {
        let d = new Date(val)
        return this.$M_FormatDate(d, 'yyyy-MM-dd')
      }
    }
  }
</script>

<style scoped lang="stylus">

</style>
